package Database;

import java.sql.*;

public class ConnectionFactory {
	private static ConnectionFactory connectionFactory = new ConnectionFactory();
	
	private ConnectionFactory(){};
	
	public static ConnectionFactory getDefaultFactory(){
		if(connectionFactory == null){
			connectionFactory = new ConnectionFactory();
		}
		
		return connectionFactory;
	}
	
	public Connection createConnection() {
		Connection connection = null;
		
		try {
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		} catch(ClassNotFoundException cnfe) {
			System.out.println(cnfe);
		}
			
		String url = "jdbc:odbc:MyODBC1";
		
		try {
			connection = DriverManager.getConnection(url);
		} catch(SQLException sqle) {
			System.out.println(sqle);
		}
		
		return connection;
	}
}